package homework;

import java.util.Scanner;

/**
 * @classname:demo03
 * @description:
 * @author: Mr.Z
 * @date: 2020/12/9 23:17
 * @version: 0.1
 * @since:1.8
 */
public class demo03 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.println("请输入一个随机字符");
        String randStr = input.next();
        StringBuilder sb = new StringBuilder();
        char[] chars = randStr.toCharArray();
        for (int i = 0; i < 6; i++) {
            int i1 = (int) (Math.random() * randStr.length()+1);
            sb.append(chars[i1]);
        }
        System.out.println(sb.toString());

    }
}
